#include "headers.h"

GLubyte *woodTexture1;
GLubyte *woodTexture3;

void miscPortaTaco(void)
{
  GLfloat X = -1085.0;
  GLfloat Y = 150.0;
  GLfloat Z = 0.0;
  GLUquadricObj *p = gluNewQuadric();

  textureLoad (woodTexture1);

  gluQuadricDrawStyle(p, GLU_FILL);
  gluQuadricNormals(p, GLU_SMOOTH);
  gluQuadricTexture(p, GL_TRUE);

  glPushMatrix();
  glColor3f(1, 1, 1);
    
  /*horizontal*/
  glPushMatrix();
  glTranslatef(X, 70 + Y, Z);
  funcDrawParalel(1, 10, 3, 50);
  glPopMatrix();

  /*horizontal*/
  glPushMatrix();
  glTranslatef(X, -60 + Y, Z);
  funcDrawParalel(1, 20, 3, 50);
  glPopMatrix();

  /*vertical*/  
  glPushMatrix();
  glTranslatef(X, Y, 20 + Z);
  funcDrawParalel(1, 10, 155, 3);
  glPopMatrix();
  
  /*vertical*/  
  glPushMatrix();
  glTranslatef(X, Y, -20 + Z);
  funcDrawParalel(1, 10, 155, 3);
  glPopMatrix();
  textureUnload();

  textureLoad(woodTexture3);
  
  glPushMatrix();
  glTranslatef(0 + X, 90 + Y, 10 + Z);
  glRotatef (90, 1.0, 0.0, 0.0);
  gluCylinder(p, 0.65, 1.7, 148, SLICES, STACKS);
  glPopMatrix();
  
  glPushMatrix();
  glTranslatef(0 + X, 90 + Y, -10 + Z);
  glRotatef (90, 1.0, 0.0, 0.0);
  gluCylinder(p, 0.65, 1.7, 148, SLICES, STACKS);
  glPopMatrix();
  textureUnload();

  glPopMatrix();

}

void miscMesinha (){
  GLfloat X = -900.0;
  GLfloat Y = 105.0;
  GLfloat Z = 200.0;
  GLUquadricObj *p = gluNewQuadric();

  textureLoad(woodTexture1);

  gluQuadricDrawStyle(p, GLU_FILL);
  gluQuadricNormals(p, GLU_SMOOTH);
  gluQuadricTexture(p, GL_TRUE);

  glEnable(GL_TEXTURE_2D);
  glPushMatrix ();
  glTranslatef (X, -5 + Y, Z);
  glColor3f(1, 1, 1);
  funcDrawParalel(1, 110, 5, 110);
  glPopMatrix ();
  
  glPushMatrix ();
  glTranslatef (X, -5 + Y, Z);
  glRotatef (90.0, 1, 0, 0);
  gluCylinder (p, 5.0, 5.0, 100, SLICES, STACKS);
  glPopMatrix ();
  
  glPushMatrix ();
  glTranslatef (X, -5 + Y, Z);
  glRotatef (90.0, 1, 0, 0);
  gluCylinder (p, 5.0, 5.0, 100, SLICES, STACKS);
  glPopMatrix ();
  textureUnload();
  
  glPushMatrix ();
  glTranslatef (X, -103 + Y, Z);
  glRotatef (-90.0, 1, 0, 0);
  glutSolidCone (40.0, 10.0, SLICES, STACKS);
  glPopMatrix ();

}


void initMisc()
{
  woodTexture1 = LoadBMP("textures/madeira1.bmp");
  woodTexture3 = LoadBMP("textures/madeira3.bmp");
}
